<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>信息</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="css/style.css" />
		<style>
			.title {
				margin: 20px 15px 10px;
				color: #6d6d72;
				font-size: 15px;
			}
			
			.oa-contact-cell.mui-table .mui-table-cell {
				padding: 11px 0;
				vertical-align: middle;
			}
			
			.oa-contact-cell {
				position: relative;
				margin: -11px 0;
			}
			
			.oa-contact-avatar {
				width: 75px;
			}
			
			.oa-contact-avatar img {
				border-radius: 50%;
			}
			
			.oa-contact-content {
				width: 100%;
			}
			
			.oa-contact-name {
				margin-right: 20px;
			}
			
			.oa-contact-name,
			.oa-contact-position {
				float: left;
			}
			
			.price {
				position: absolute;
				top: 35px;
				right: 0px;
				font-size: 16px;
				font-weight: bold;
				color: #FF0000;
			}
			
			.mui-card .mui-control-content {
				padding: 10px;
			}
			
			.mui-control-content {
				height: 435px;
			}
			
			.mui-segmented-control {
				border: 0;
				border-bottom: 1px solid #C8C7CC;
				height: 60px;
			}
			
			.mui-segmented-control .mui-control-item.mui-active {
				background: none;
				color: #15B5E9;
				border-bottom: 2px solid;
			}
			
			.mui-segmented-control .mui-control-item {
				color: #666666;
				border-left: 0;
			}
			
			.uptab {
				/*padding: 10px 10px;*/
				background: #FFFFFF;
				margin-top: 8px;
			}
			
			.mui-segmented-control .mui-control-item {
				line-height: 60px;
			}
			
			.mui-ellipsis-2 {
				display: -webkit-box;
				overflow: hidden;
				white-space: normal!important;
				text-overflow: ellipsis;
				word-wrap: break-word;
				-webkit-line-clamp: 6;
				-webkit-box-orient: vertical;
				padding-top: 10px;
				font-size: 15px;
				line-height: 1.4rem;
			}
			
			.tableUL {
				background: #FFFFFF;
				margin-top: 0.3rem;
			}
			
			.mui-table-view {
				background-color: #efeff4;
			}
			
			.mui-table-view-cell:after {
				left: 0;
			}
			
			.mui-pull-right {
				font-size: 14px;
				color: #737372;
				font-weight: bold;
			}
			
			.ziti {
				font-size: 15px;
				color: #000000;
				font-weight: bold;
			}
			
			.mui-table-view-chevron .mui-table-view-cell>a:not(.mui-btn) {
				margin-right: -115px;
			}
			
			.imgmsg {
				/* width: 80%; */
				max-width: 45%;
				margin: 0 auto;
				display: table;
				padding-top: 50px;
			}
			
			.mui-table-view:after {
				position: absolute;
				right: 0;
				bottom: 0;
				left: 0;
				height: 0px;
				content: '';
				-webkit-transform: scaleY(.5);
				transform: scaleY(.5);
				background-color: #c8c7cc;
			}
			
			.mui-table-view-chevron {
				margin-bottom: 77px;
				
			}
		</style>
	</head>

	<body>
		<div id="refreshContainer" class="mui-content mui-scroll-wrapper">
			<div class="mui-scroll">
				<ul class="mui-table-view mui-table-view-chevron" id="messageUL">
					<!--<p><img class="imgmsg" src="../images/no_data/1-03.png" data-preview-src="" data-preview-group="1"></p>-->
					<!--<li class="mui-table-view-cell mui-media tableUL">
						<a href="javascript:;" data-title-type="native">
							<img class="mui-media-object mui-pull-left" src="../images/xtxx.png">
							<div class="mui-media-body">
								<span class="ziti">系统升级消息</span>
								<span class="doctor mui-pull-right">2017年7月27日</span>
								<p class="mui-ellipsis-2">2017/08/31 柒拾佳护APP进行版本升级升级版本为1.0.0版本</p>
							</div>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media tableUL">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="../images/ddxx.png">
							<div class="mui-media-body">
								<span class="ziti">订单消息</span>
								<span class="doctor mui-pull-right">2017年7月27日</span>
								<p class="mui-ellipsis-2">订单号：DD01158963 在12：30分由吉林大学第一医院，呼吸科，丁丽辉副主任护师 接单成功，医护人员会及时和您沟通请注意查收</p>
							</div>
						</a>
					</li>-->
				</ul>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../js/mui.min.js"></script>
	<script type="text/javascript" src="../js/app.js"></script>
	<script type="text/javascript" src="../js/constants.js"></script>
	<script type="text/javascript" src="../js/sharemethods.js"></script>
	<script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>

	<script type="text/javascript" src="../plugs/moment/moment.min.js"></script>
	<script type="text/javascript" src="../plugs/art/template-web.js"></script>
	<script type="text/javascript" src="../plugs/qs/qs.art.extend.js"></script>
	<script type="text/javascript" src="../plugs/qs/qs.template.js"></script>

	<script>
		var page = 1;
		var limit = 5;
		var pulldownEnd = false;
		mui.init({
			swipeBack: true, //启用右滑关闭功能
			pullRefresh: {
				container: "#refreshContainer", //下拉刷新容器标识，querySelector能定位的css选择器均可，比如：id、.class等
				down: {
					callback: pulldownRefresh
				}
			}
		});

		function pulldownRefresh() {
			setTimeout(function() {
				if(!pulldownEnd) {
					var table = document.body.querySelector('.mui-table-view');

					var sussess = function(data) {
						//服务器返回响应，根据响应结果，分析是否登录成功；
						if(data.result == "success") {
							if(data.obj.length < limit) {
								pulldownEnd = true;
							} else {
								page = page + 1;
							}
							data.obj.forEach(function(v, i) {
								$("#messageUL").processTL(templateRegister.common, v, 'prepend')
							});
						} else {
							mui.toast(data.msg);
						}
					};
					commonHttpUtils(notificationurl + "&page=" + page + "&limit=" + limit, "get", "", sussess, error);

				} else {
					mui.toast("没有更多消息了");
				}
				mui('#refreshContainer').pullRefresh().endPulldownToRefresh(); //refresh completed
			}, 1500);

		}
		var userId = null;
		var notificationurl = null;
		mui.plusReady(function() {
			userId = localStorage.getItem("USERID");
			init();
		});

		function init() {
			page = 1;
			notificationurl = getnotificationUrl + '?id=' + userId;
			var sussess = function(data) {
				//服务器返回响应，根据响应结果，分析是否登录成功；
				if(data.result == "success") {
					if(data.obj.length == 0) {
						$('#messageUL').html('<p id="emptyImg"><img class="imgmsg" src="../images/no_data/1-03.png" data-preview-src="" data-preview-group="1"></p>')
					} else {
						$('#messageUL').html()
						if(data.obj.length < limit) {
							pulldownEnd = true;
						} else {
							page = page + 1;
						}
						data.obj.forEach(function(v, i) {
							$("#messageUL").processTL(templateRegister.common, v, 'prepend')
						});
					}
				} else {
					mui.toast(data.msg);
				}
			};
			commonHttpUtils(notificationurl + "&page=" + page + "&limit=" + limit, "get", "", sussess, error);
		}
	</script>

</html>